Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ACP-118 Aggregator #3394

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open

Implement ACP-118 Aggregator #3394

wants to merge 62 commits into from

Conversation

joshua-kim
Copy link
Contributor

@joshua-kim joshua-kim commented Sep 17, 2024

Why this should be merged

Implements p2p client + server logic for signature request handling as described in acp-118 (ref).

How this works

Client:

  • Introduces an aggregator type which will make signature requests in batches block until a caller-provided threshold of stake signs the provided warp message
  • Introduces a server handler that servers aggregation requests

How this was tested

  • Added unit tests

@joshua-kim joshua-kim changed the base branch from master to p2p-sync September 17, 2024 16:08
@joshua-kim joshua-kim self-assigned this Sep 17, 2024
@joshua-kim joshua-kim force-pushed the acp-118 branch 6 times, most recently from 368ad1a to 2a47036 Compare September 18, 2024 15:30
Base automatically changed from p2p-sync to master September 25, 2024 16:58
@joshua-kim joshua-kim force-pushed the acp-118 branch 2 times, most recently from 6e6e88f to cf4ecba Compare October 1, 2024 18:19
@joshua-kim joshua-kim changed the title Implement ACP-118 Package Implement ACP-118 Aggregator Oct 22, 2024
@joshua-kim joshua-kim force-pushed the acp-118 branch 2 times, most recently from b4d7b35 to 60761f8 Compare October 22, 2024 20:14
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
@joshua-kim joshua-kim marked this pull request as ready for review November 12, 2024 21:48
network/p2p/acp118/aggregator.go Outdated Show resolved Hide resolved
network/p2p/acp118/aggregator.go Outdated Show resolved Hide resolved
network/p2p/acp118/aggregator.go Outdated Show resolved Hide resolved
network/p2p/acp118/aggregator.go Outdated Show resolved Hide resolved
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
network/p2p/p2ptest/client.go Outdated Show resolved Hide resolved
network/p2p/p2ptest/client.go Outdated Show resolved Hide resolved
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This seems like it would really simplify the p2p integration in signature-aggregator. by leveraging the existing p2p.Client. We re-implement a lot of the response handling and routing logic.

return nil, nil, nil, false, err
}

return msg, aggregatedStakeWeight, totalStakeWeight, false, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[no action required] It looks like this is the only case that returns a non-nil message with finished=false. Could we simplify the function signature by removing that parameter and assuming the caller is aware of a cancelled context?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants